﻿CREATE PROCEDURE dbo.procCreateAssemblyInfo
	@ExceptionID char(49),
	@AssemblyName nVarChar(MAX),
	@CompanyName nVarChar(MAX),
	@Copyright nVarChar(MAX),
	@Description nVarChar(MAX),
	@DirectoryPath nVarChar(MAX),
	@ProductName nVarChar(MAX),
	@StackTrace nVarChar(MAX),
	@Title nVarChar(MAX),
	@Trademark nVarChar(MAX),
	@Version nVarChar(MAX),
	@WorkingSet bigInt,
	@AssemblyInfoID int OUTPUT
AS

/****************************************************************************************************
 **        Name: procCreateAssemblyInfo
 ** Description: Creates a new AssemblyInfo record.
 ****************************************************************************************************
 ** Revisions
 **  Date        Author               Work Item  Description
 **  ----------  -------------------  ---------  ----------------------------------------------------
 **  11/30/2008  Chad Green             11774    Initial Development
 **  02/21/2009  Chad Green             11774    Added the @AssemblyInfoID output parameter and no longer returning the SCOPE_IDENTITY
 ****************************************************************************************************/

SET @AssemblyInfoID = 0

BEGIN TRY

	-- Create the new record
	INSERT INTO dbo.AssemblyInfo (ExceptionID,
	                              AssemblyName,
	                              CompanyName,
	                              Copyright,
	                              Description,
	                              DirectoryPath,
	                              ProductName,
	                              StackTrace,
	                              Title,
	                              Trademark,
	                              Version,
	                              WorkingSet)
	                      VALUES (@ExceptionID,
	                              @AssemblyName,
	                              @CompanyName,
	                              @Copyright,
	                              @Description,
	                              @DirectoryPath,
	                              @ProductName,
	                              @StackTrace,
	                              @Title,
	                              @Trademark,
	                              @Version,
	                              @WorkingSet)

	-- Return the record identifier
	SET @AssemblyInfoID = @@IDENTITY
	
END TRY
BEGIN CATCH
	EXEC procCreateSQLErrorLog
END CATCH